#ifndef FILA_H
#define FILA_H

#include "container.hpp"

template<class T>
class fila : public container<T>
{
public:
	
	fila();
	
	void
	push( T );

	void
	push( fila<T> );
private:
	
	noh<T>*
	last;

};



/**************************************
 * 
 * Implementations...
 * 
 * ************************************/

template<class T>
fila<T>::fila()
{
	this->last = 0;
}


template<class T> void
fila<T>::push( T _info)
{
	noh<T>*
	newNoh = new noh<T>(_info);
	
	if (this->cursor == 0)
	{
		this->cursor = newNoh;
		this->last = newNoh;
	}
	else
	{
		this->last->setPosterior(newNoh);
		
		this->last = newNoh;
	}
}

template<class T> void
fila<T>::push ( fila<T> _filinha )
{
	while (! _filinha.isEmpty() )
	{
		this->push ( _filinha.getInfo() );
		_filinha.pop();
	}
}

#endif /* FILA_H */
